<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/ui.tld" prefix="ui" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>查重页面</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <!-- 查询表单 -->
        <form id="searchBar">
            <div class="fieldset1 clearFix">
	            <div class="fieldBox">
	                    <div class="label">注册地址</div>
	                    <div class="field">
	                        <input name="addr" class = 'ui-textbox' id="addr" type="text" value="${addr}" readonly>
	                    </div>
                </div>
                <div class="fieldset1">
		            <div class="fieldBox">
		                    <div class="label">名称</div>
		                    <div class="field">
		                        <input name="name" class = 'ui-textbox' id="name" type="text">
		                    </div>
	                </div>
                </div>
                <div class="fieldBox">
                    <div class="label">属性</div>
                    <div class="field">
                        <select name="relTypCd" id="relTypCd">
                        	<option value=" " checked>请选择</option>
                            <c:forEach items="${relMap }" var="rel">
                                <option value="${rel.key }">${rel.value }</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">属性性质</div>
                    <div class="field">
                        <select name="propTypCd" id="propTypCd">
                        	<option value=" " checked>请选择</option>
                            <c:forEach items="${propMap }" var="prop">
                                <option value="${prop.key }">${prop.value }</option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
              
                <div class="clearFix"></div>
                <div class="btnsBox formBtns notRight">
                    <span id="searchBtn" class="sq-button-round" onclick="searchBtnEvent()">查询</span>
                </div>
            </div>
        </form>
    </div>
    <!-- 列表显示块 -->
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
/* 	var _certNo = '${certNo}';// 证件号
	
	var grid = null;
	var type = '${type}'; //查重类型
	var value = '${value}'; //查重内容
	var queryFlag = '${queryFlag}'; //只查询列表
	var updateFlag = '${updateFlag}';//业务移交
	var taskTransfer = '${taskTransfer}';//业务交接
	var updateSunFlag = '${updateSunFlag}';//供应商及账号修改
	
	var _reCstNm = '${reCstNm}';
	var _reCertNo = '${reCertNo}';
	var _reIdAddr = '${reIdAddr}';
	var _reMp1 = '${reMp1}';
	var _reWorkPlc = '${reWorkPlc}';
	var _rePostAddr = '${rePostAddr}';
	var _reWorkAddr = '${reWorkAddr}';
	var _cstTypCd = '${cstTypCd}';
	var _prjId = '${prjId}';
	var _vinListStr = '${vinListStr}'; 
	var pageInApp={}; // to 下一级子窗口 接口
    var pageInTab=null;*/
	
	
	$(function () {
		$("#searchBar").ligerForm();
		var form = new liger.get("searchBar");
		var data = form.getData();
	    $("#ligergrid1").ligerGrid({
	    	url: '<%=path%>/spl/regAddrRel/toListPage.do',
	    	method : 'get',
	    	parms:data,
	        columns: [
	             { display: '供应商名称', name: 'name', align:'left',minWidth: 140 ,
	            	render: function (rowdata, rowindex, value, column) { 
	            		var h = '';
	            			if(value&&value!="null"){
	            		    h+='<a href="javascript:detailBtn(';
	                        h+="'"+rowdata.id+"'";
	                        h+=",'"+rowdata.relTypCd+"'";
	                        h+=')">'+value+'</a>'
	            			}
	                        return h;
	            		},
	            	enabledSort:true},
	             { display: '属性', name: 'relTypCdNm', minWidth: 140 ,align:'center', enabledSort:true}, 
	             { display: '属性性质', name: 'propTypCdNm', minWidth: 100,align:'center', enabledSort:true},
	             { display: '注册地址', name: 'addr', minWidth: 100,align:'center', enabledSort:true},
	            /*  { display: '证件号人员名称', name: 'name', minWidth: 100,align:'center', enabledSort:true},
	             { display: '证件号', name: 'idNum', minWidth: 100,align:'center', enabledSort:true} */
	        ],
	        pageSize:10,
	        root:'rows',
	        record:'total',
	        hideLoadButton : true,
	        width: '100%',
	        height:'100%',
	        heightDiff:-20,
	        //isScroll: false,
	        checkbox:false,
	        delayLoad:true,
	        rownumbers:true,
	    });
	 //   initOrgTree();
	    grid = liger.get("ligergrid1");
	    grid.setHeight(100);
	    $("#searchBar").ligerForm();
	    $("#searchBtn").click(function(event) {
	         var form = new liger.get("searchBar");
	         var data = form.getData();
	         data["crtTm"] = $("#crtTm").val();
	         for (name in data){
	            grid.setParm(name,data[name]);
	         };
	         //grid.setParm('reCertNo','');
	         //grid.setParm('reCstNm','');
	         //grid.setParm('reMp1','');
	         //grid.setParm('vinListStr','');
	        grid.reload();
	    });
	
	    //var form = new liger.get("searchBar");
        //var data = form.getData();
        //data["crtTm"] = $("#crtTm").val();
        //for (name in data){
          // grid.setParm(name,data[name]);
        //};
        
        grid.reload();
	    $("#pageloading").hide();
	});
	    
	function detailBtn(id,relTypCd){
		if(StringUtils.isEmpty(id)) return ;
		if(StringUtils.isEmpty(relTypCd)) return ;
		//alert(id);
		if(relTypCd == 1){
			Add_navTab('tab_msg_prj_1','详情页面','<%=path%>/customer/cstbscinfo/toCustCstBacInfoNpDetailPage.do?id='+id+'&splAttrCd='+relTypCd);
		}else if(relTypCd == 2){
			Add_navTab('tab_msg_prj_2','详情页面','<%=path%>/product/splInfo/toDetailPage.do?id='+id+'&splAttrCd='+relTypCd);
		}else if(relTypCd == 3){
			Add_navTab('tab_msg_prj_3','详情页面','<%=path%>/project/prjlnkcomp/toDetailPage.do?id='+id+'&splAttrCd='+relTypCd);
		}else if(relTypCd == 4){
			Add_navTab('tab_msg_prj_4','详情页面','<%=path%>/product/mfrInfo/toDetailPage.do?id='+id+'&splAttrCd='+relTypCd);
		}
	}   
	function initOrgTree(){
    	var params = {};
    		params.cstMgrOrgCd = '${currOrg}';
    	 searchOrgTree = $("#cstMgrOrgCd").ligerComboBox({
    		 width: 480,
             selectBoxWidth: 480,
             selectBoxHeight: 150,
             //限制只能选叶节点，父节点不能点击
             treeLeafOnly: false,
             valueField: 'orgCd',
             textField: 'orgDispNm',
             showTreePath: true,
             tree: {
                 ajaxType: 'get',
                 idFieldName:'orgCd',
                 textFieldName: 'orgDispNm',
                 checkbox: false,
                 parentIcon: "none",
                 childIcon: "none",
                 needCancel : false
             }
         });
    	 $.ajax({
     		type: 'get',
     		dataType:'json',
     		data: params,
     		url: '<%=path%>/project/prjbscinfo/searchBuOrgTree.do',
     		success:function(msg){
     			if(msg.success == 1){
     				searchOrgTree.treeManager.setData(msg.data);
     				searchOrgTree.clear();
     				searchOrgTree.setValue('${currOrg}');
     			}else{
     				 $.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
     			}
     		}
     	});
    	 
    }    
	
	<%-- function detailBtn(id){
		var fromPrjFlag = true;
		var detailFlag = true;
		var _flag = $("#fromPrjFlagId").val();//来自哪里
		if(StringUtils.isNotEmpty(_flag)){
			if(_flag == 'false'){
				fromPrjFlag = false;
			}
		}
		Add_navTab('tab_project_detail'+id,'项目详情','<%=path%>/project/prjbscinfo/toModifyPage.do?fromPrjFlag='+fromPrjFlag+'&&id='+id+'&&detailFlag='+detailFlag);
	}
	 --%>
<%-- 	function searchCredit(_projectId) {
        if(!_projectId)return;
        Add_navTab("toTripartitePage"+_projectId, "人行征信及三方", '<%=path%>/riskctrl/rskctrl/toMainPage.do?id='+_projectId);
    }
	function payDetail(prjId){
		var payDetailUrl = '<%=path%>/project/prjprdpayschm/toPrjPrdPaySchMAndDListPage.do?prjId='+prjId;
		Add_navTab('tab_prj_quat_prps_pay_prj'+prjId,'查看还款情况(项目)',payDetailUrl);
	}
	function showReport(id){
		 $.ligerDialog.open({title: '报告列表',height: 300,width: 550, 
	        	url: '<%=path%>/car300/infCar300Rec/toReportListPage.do?prjId='+id
	        });
	}; --%>
	    
	
	//格式化时间
	function renderDate(rowdata, index, value){
		var dateStr = "";
		if(null != value){
			var date = new Date(value);
			dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
		}
		return dateStr;
	}
	
</script>
  
</body>
</html>
